﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>Ping: StateForge::Examples::Ping::Ping Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                C# examples using state machines generated by StateBuilderDotNet
            </h1>
            <h3>
                Ping: StateForge::Examples::Ping::Ping Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="namespace_state_forge.html">StateForge</a>      </li>
      <li class="navelem"><a class="el" href="namespace_state_forge_1_1_examples.html">Examples</a>      </li>
      <li class="navelem"><a class="el" href="namespace_state_forge_1_1_examples_1_1_ping.html">Ping</a>      </li>
      <li class="navelem"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html">Ping</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#properties">Properties</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-static-methods">Static Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="#pri-static-attribs">Static Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">StateForge::Examples::Ping::Ping Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="StateForge::Examples::Ping::Ping" -->
<p><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html" title="Ping.">Ping</a>.  
 <a href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#details">More...</a></p>

<p><a href="class_state_forge_1_1_examples_1_1_ping_1_1_ping-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#adeda07c6acc07ff45cb62e0f6ae7009a">Ping</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ab98997fbc52e65a6e49fb67b1f343395">DoCancel</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a99abd067b774452cdf12d977950cb9c9">ShowPingResults</a> (PingReply pingResponse)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a07b9a37bc1c0293a6c8f02671fe334f8">PrintStatistics</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="properties"></a>
Properties</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a3b640bf63fa2742e4793c6a205e181f1">Timeout</a><code> [get, set]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">String&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ac86d7dee47f8f610b1cb25dcd9d1816e">Target</a><code> [get, set]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9d0425fd73b064dc59a4ea6721b69007">Count</a><code> [get, set]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a493b31d0e1c6e82d570f4a47261459c8">Rx</a><code> [get, set]</code></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7ec64462dcb153d765c478d058d1c7d5">Tx</a><code> [get, set]</code></td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">internal void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a1273f29582718355eba6465aad3c9d48">Send</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">internal void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#add1d8cd6f73938c1a97d702ca26ec601">PingComplete</a> (object sender, PingCompletedEventArgs e)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#accc95ebb4741f480bd3e832bfaeed55a">Reset</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0f20a41e749a4052eace665ca3f3cf40">StateMachineEnd</a> (object sender, EventArgs e)</td></tr>
<tr><td colspan="2"><h2><a name="pri-static-methods"></a>
Static Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0b0c6bc86532d61fa5827ece9c3aa4d2">Main</a> (string[] args)</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PingContext&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">System.Net.NetworkInformation.Ping&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a47cc42c8cea76f5fadfd94019264f4e2">pingSender</a> = new System.Net.NetworkInformation.Ping()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">PingOptions&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9101124f2c1d70ab83ee12f0a8e12308">packetOptions</a> = new PingOptions(50, true)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">byte[]&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a55609dbfd44678f7fd5695112c42957a">packetData</a> = Encoding.ASCII.GetBytes(&quot;................................&quot;)</td></tr>
<tr><td colspan="2"><h2><a name="pri-static-attribs"></a>
Static Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static readonly string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a5f697343d4b6f2c89adf51ad9618ec7d">traceName</a> = &quot;Ping&quot;</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static TraceSource&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a> = new TraceSource(<a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a5f697343d4b6f2c89adf51ad9618ec7d">traceName</a>)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static AutoResetEvent&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0ee5fedb00c437de9de0156cfe2b6cf0">autoResetEvent</a> = new AutoResetEvent(false)</td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p><a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html" title="Ping.">Ping</a>. </p>

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00014">14</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="adeda07c6acc07ff45cb62e0f6ae7009a"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Ping" ref="adeda07c6acc07ff45cb62e0f6ae7009a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">StateForge::Examples::Ping::Ping::Ping </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00031">31</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a47cc42c8cea76f5fadfd94019264f4e2">pingSender</a>.PingCompleted += <span class="keyword">new</span> PingCompletedEventHandler(<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#add1d8cd6f73938c1a97d702ca26ec601">PingComplete</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a> = <span class="keyword">new</span> PingContext(<span class="keyword">this</span>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.Observer = ObserverTrace.Instance(<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a5f697343d4b6f2c89adf51ad9618ec7d">traceName</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.EndHandler += <span class="keyword">new</span> EventHandler&lt;EventArgs&gt;(<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0f20a41e749a4052eace665ca3f3cf40">StateMachineEnd</a>);
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.EnterInitialState();
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#accc95ebb4741f480bd3e832bfaeed55a">Reset</a>();
        }
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab98997fbc52e65a6e49fb67b1f343395"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::DoCancel" ref="ab98997fbc52e65a6e49fb67b1f343395" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::Ping::Ping::DoCancel </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00042">42</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a47cc42c8cea76f5fadfd94019264f4e2">pingSender</a>.SendAsyncCancel();
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a0b0c6bc86532d61fa5827ece9c3aa4d2"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Main" ref="a0b0c6bc86532d61fa5827ece9c3aa4d2" args="(string[] args)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void StateForge::Examples::Ping::Ping::Main </td>
          <td>(</td>
          <td class="paramtype">string[]&#160;</td>
          <td class="paramname"><em>args</em></td><td>)</td>
          <td><code> [inline, static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00115">115</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#adeda07c6acc07ff45cb62e0f6ae7009a">Ping</a> ping = <span class="keyword">new</span> <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#adeda07c6acc07ff45cb62e0f6ae7009a">Ping</a>();
            ping.Target = <span class="stringliteral">&quot;127.0.0.1&quot;</span>;
            ping.StartPing();
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0ee5fedb00c437de9de0156cfe2b6cf0">autoResetEvent</a>.WaitOne();
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceInformation(<span class="stringliteral">&quot;Ping has ended&quot;</span>);
            Environment.Exit(0);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="add1d8cd6f73938c1a97d702ca26ec601"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::PingComplete" ref="add1d8cd6f73938c1a97d702ca26ec601" args="(object sender, PingCompletedEventArgs e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">internal void StateForge::Examples::Ping::Ping::PingComplete </td>
          <td>(</td>
          <td class="paramtype">object&#160;</td>
          <td class="paramname"><em>sender</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PingCompletedEventArgs&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00053">53</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <span class="keywordflow">if</span> (e.Cancelled)
            {
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceInformation(<span class="stringliteral">&quot;Ping was canceled&quot;</span>);

            }

            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (e.Error != null)
            {
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceEvent(TraceEventType.Error, 1, <span class="stringliteral">&quot;An error occured: {0}&quot;</span>, e.Error);
                this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.EvError();
            }

            <span class="keywordflow">else</span>
            {
                PingReply pingResponse = e.Reply;
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a99abd067b774452cdf12d977950cb9c9">ShowPingResults</a>(pingResponse);
            }
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a07b9a37bc1c0293a6c8f02671fe334f8"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::PrintStatistics" ref="a07b9a37bc1c0293a6c8f02671fe334f8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::Ping::Ping::PrintStatistics </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00104">104</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            Console.WriteLine(<span class="stringliteral">&quot;Ping to {0}  attempt {1} of {2}, error: {3}&quot;</span>, this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ac86d7dee47f8f610b1cb25dcd9d1816e">Target</a>, this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7ec64462dcb153d765c478d058d1c7d5">Tx</a>, this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9d0425fd73b064dc59a4ea6721b69007">Count</a>, this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7ec64462dcb153d765c478d058d1c7d5">Tx</a> - this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a493b31d0e1c6e82d570f4a47261459c8">Rx</a>);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="accc95ebb4741f480bd3e832bfaeed55a"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Reset" ref="accc95ebb4741f480bd3e832bfaeed55a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::Ping::Ping::Reset </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00095">95</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ac86d7dee47f8f610b1cb25dcd9d1816e">Target</a> = <span class="stringliteral">&quot;127.0.0.1&quot;</span>;
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a3b640bf63fa2742e4793c6a205e181f1">Timeout</a> = 1000; <span class="comment">/* msec */</span>
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9d0425fd73b064dc59a4ea6721b69007">Count</a> = 5;
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a493b31d0e1c6e82d570f4a47261459c8">Rx</a> = 0;
            this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7ec64462dcb153d765c478d058d1c7d5">Tx</a> = 0;
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a1273f29582718355eba6465aad3c9d48"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Send" ref="a1273f29582718355eba6465aad3c9d48" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">internal void StateForge::Examples::Ping::Ping::Send </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00047">47</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceInformation(<span class="stringliteral">&quot;Ping: Send to {0}&quot;</span>, this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ac86d7dee47f8f610b1cb25dcd9d1816e">Target</a>);
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a47cc42c8cea76f5fadfd94019264f4e2">pingSender</a>.SendAsync(this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#ac86d7dee47f8f610b1cb25dcd9d1816e">Target</a>, (<span class="keywordtype">int</span>)this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a3b640bf63fa2742e4793c6a205e181f1">Timeout</a>, <span class="keyword">this</span>);
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a99abd067b774452cdf12d977950cb9c9"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::ShowPingResults" ref="a99abd067b774452cdf12d977950cb9c9" args="(PingReply pingResponse)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::Ping::Ping::ShowPingResults </td>
          <td>(</td>
          <td class="paramtype">PingReply&#160;</td>
          <td class="paramname"><em>pingResponse</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00074">74</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <span class="keywordflow">if</span> (pingResponse == null)
            {
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceEvent(TraceEventType.Warning, 1, <span class="stringliteral">&quot;There was no response&quot;</span>);
                <span class="keywordflow">return</span>;
            }
            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pingResponse.Status == IPStatus.Success)
            {
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceEvent(TraceEventType.Information, 1, <span class="stringliteral">&quot;Reply from {0}  RTT {1}&quot;</span>,
                    pingResponse.Address.ToString(),
                    pingResponse.RoundtripTime);
                this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.EvPingReply();
            }
            <span class="keywordflow">else</span>
            {
                <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceEvent(TraceEventType.Warning, 1, <span class="stringliteral">&quot;Ping was unsuccessful, ip status {0}&quot;</span>, pingResponse.Status);
                this.<a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">context</a>.EvError();
            }
        }
</pre></div>
</div>
</div>
<a class="anchor" id="a0f20a41e749a4052eace665ca3f3cf40"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::StateMachineEnd" ref="a0f20a41e749a4052eace665ca3f3cf40" args="(object sender, EventArgs e)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void StateForge::Examples::Ping::Ping::StateMachineEnd </td>
          <td>(</td>
          <td class="paramtype">object&#160;</td>
          <td class="paramname"><em>sender</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">EventArgs&#160;</td>
          <td class="paramname"><em>e</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00109">109</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>
<div class="fragment"><pre class="fragment">        {
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">ts</a>.TraceInformation(<span class="stringliteral">&quot;State machine has ended&quot;</span>);
            <a class="code" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0ee5fedb00c437de9de0156cfe2b6cf0">autoResetEvent</a>.Set();
        }
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="a0ee5fedb00c437de9de0156cfe2b6cf0"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::autoResetEvent" ref="a0ee5fedb00c437de9de0156cfe2b6cf0" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">AutoResetEvent <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a0ee5fedb00c437de9de0156cfe2b6cf0">StateForge::Examples::Ping::Ping::autoResetEvent</a> = new AutoResetEvent(false)<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00025">25</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a7adc8c44ef031b1b9aa0f394cf040b67"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::context" ref="a7adc8c44ef031b1b9aa0f394cf040b67" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PingContext <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a7adc8c44ef031b1b9aa0f394cf040b67">StateForge::Examples::Ping::Ping::context</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00022">22</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a55609dbfd44678f7fd5695112c42957a"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::packetData" ref="a55609dbfd44678f7fd5695112c42957a" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">byte [] <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a55609dbfd44678f7fd5695112c42957a">StateForge::Examples::Ping::Ping::packetData</a> = Encoding.ASCII.GetBytes(&quot;................................&quot;)<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00029">29</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a9101124f2c1d70ab83ee12f0a8e12308"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::packetOptions" ref="a9101124f2c1d70ab83ee12f0a8e12308" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PingOptions <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9101124f2c1d70ab83ee12f0a8e12308">StateForge::Examples::Ping::Ping::packetOptions</a> = new PingOptions(50, true)<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00028">28</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a47cc42c8cea76f5fadfd94019264f4e2"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::pingSender" ref="a47cc42c8cea76f5fadfd94019264f4e2" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">System.Net.NetworkInformation.Ping <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a47cc42c8cea76f5fadfd94019264f4e2">StateForge::Examples::Ping::Ping::pingSender</a> = new System.Net.NetworkInformation.Ping()<code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00027">27</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a5f697343d4b6f2c89adf51ad9618ec7d"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::traceName" ref="a5f697343d4b6f2c89adf51ad9618ec7d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">readonly string <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a5f697343d4b6f2c89adf51ad9618ec7d">StateForge::Examples::Ping::Ping::traceName</a> = &quot;Ping&quot;<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00023">23</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a9432c160689a1e533e1037502dd59a01"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::ts" ref="a9432c160689a1e533e1037502dd59a01" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TraceSource <a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a9432c160689a1e533e1037502dd59a01">StateForge::Examples::Ping::Ping::ts</a> = new TraceSource(<a class="el" href="class_state_forge_1_1_examples_1_1_ping_1_1_ping.html#a5f697343d4b6f2c89adf51ad9618ec7d">traceName</a>)<code> [static, private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00024">24</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<hr/><h2>Property Documentation</h2>
<a class="anchor" id="a9d0425fd73b064dc59a4ea6721b69007"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Count" ref="a9d0425fd73b064dc59a4ea6721b69007" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int StateForge::Examples::Ping::Ping::Count<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00018">18</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a493b31d0e1c6e82d570f4a47261459c8"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Rx" ref="a493b31d0e1c6e82d570f4a47261459c8" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int StateForge::Examples::Ping::Ping::Rx<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00019">19</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="ac86d7dee47f8f610b1cb25dcd9d1816e"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Target" ref="ac86d7dee47f8f610b1cb25dcd9d1816e" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">String StateForge::Examples::Ping::Ping::Target<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00017">17</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a3b640bf63fa2742e4793c6a205e181f1"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Timeout" ref="a3b640bf63fa2742e4793c6a205e181f1" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double StateForge::Examples::Ping::Ping::Timeout<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00016">16</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<a class="anchor" id="a7ec64462dcb153d765c478d058d1c7d5"></a><!-- doxytag: member="StateForge::Examples::Ping::Ping::Tx" ref="a7ec64462dcb153d765c478d058d1c7d5" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int StateForge::Examples::Ping::Ping::Tx<code> [get, set]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_ping_8cs_source.html#l00020">20</a> of file <a class="el" href="_ping_8cs_source.html">Ping.cs</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="_ping_8cs_source.html">Ping.cs</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
